<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Event extends MemberController
{
	/**
	* Constructeur
	*/
	public function __construct()
	{
		parent::__construct();
		
		//On change le titre de la page
		parent::setPageName('Partager du contenu');
		
		//On change la vue du menu
		parent::setMenuView('menu/share_menu');
	}
	
	public function add_validation()
	{}
	
	public function add()
	{
			parent::setPageName('Ajouter un événement');
			parent::loadHeader();
			
			$data['list_event'] =  Events::getAllType_event();
			
			$this->load->view('notification_zone');
			$this->load->view('form/add_event',$data);
			parent::loadFooter();
		
	}
	
	public function ajax_getEvent_by_type()
	{
		$type_event = $_POST['type_event'];
		$region = $_POST['region'];

		$data['data'] = Events::getEvent_by_type($region,$type_event);
		//list event cordonnées lg/lat
		$this->load->view('list_lieu',$data);
		//echo json_encode($event_list);

	}
	
		public function index()
	{
			parent::loadHeader();
			
			$this->load->view('event/index');
			
			parent::loadFooter();
	}

}
